﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISettingsProviderConfiguration.cs" company="DevDigital">
//   DevDigital
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Settings.NET
{
    /// <summary>
    /// Settings provider configuration
    /// </summary>
    public interface ISettingsProviderConfiguration
    {
        /// <summary>
        /// Sets the default serializer to use for any settings provider created from this factory.
        /// </summary>
        /// <typeparam name="TSerializer">The type of the serializer.</typeparam>
        /// <returns>The settings provider configuration</returns>
        ISettingsProviderConfiguration WithDefaultSerializer<TSerializer>() where TSerializer : ISettingsSerializer, new();

        /// <summary>
        /// Sets the default serializer to use for any settings provider created from this factory.
        /// </summary>
        /// <param name="serializer">The serializer.</param>
        /// <returns>The settings provider configuration</returns>
        ISettingsProviderConfiguration WithDefaultSerializer(ISettingsSerializer serializer);

        /// <summary>
        /// Sets the default caching to use for any settings provider created from this factory.
        /// </summary>
        /// <typeparam name="TCache">The type of the cache.</typeparam>
        /// <returns>The settings provider configuration</returns>
        ISettingsProviderConfiguration WithDefaultCache<TCache>() where TCache : ISettingsCache, new();

        /// <summary>
        /// Sets the default caching to use for any settings provider 
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <returns>The settings provider configuration</returns>
        ISettingsProviderConfiguration WithDefaultCache(ISettingsCache cache);

        /// <summary>
        /// Gets an instance of the settings provider using the current default configuration
        /// </summary>
        /// <returns>The settings provider instance</returns>
        ISettingsProvider Get();
    }
}